In [1]:
import pandas as pd
import numpy as np
from pmdarima import auto_arima
import plotly.graph_objects as go
from sklearn.metrics import mean_absolute_error, mean_squared_error
import os
In [2]:
# !pip install -U kaleido # you need to install for the visualization

using CA Datasets¶

In [3]:
# Read the Excel file
# Data_Status: Indicates the status of the data. The value "2020F" suggests that it is a forecast for the year 2020.
# State: Represents the state for which the data is recorded (in this case, "CA" for California).
# MSN: Stands for "Monthly State Names" and refers to the specific energy metric or variable being measured. Examples include ARICD, ARICV, ARTCD, ARTCV, ARTXD, WWTXV, WXICD, WXICV, ZWCDP, ZWHDP.
df = pd.read_csv('Datasets/pr_CA.csv')
df.drop('Data_Status',axis=1,inplace=True)
In [4]:
df
Out[4]:
State MSN 1970 1971 1972 1973 1974 1975 1976 1977 ... 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
0 CA ARICD 0.49 0.64 0.64 0.69 1.47 1.62 1.60 1.70 ... 14.83 16.79 15.59 15.97 13.57 10.04 9.90 12.56 13.42 11.36
1 CA ARICV 39.00 51.90 52.30 60.50 115.90 141.00 149.60 169.10 ... 891.20 903.80 937.00 916.30 834.50 614.10 592.70 758.60 744.60 636.30
2 CA ARTCD 0.49 0.64 0.64 0.69 1.47 1.62 1.60 1.70 ... 14.83 16.79 15.59 15.97 13.57 10.04 9.90 12.56 13.42 11.36
3 CA ARTCV 39.00 51.90 52.30 60.50 115.90 141.00 149.60 169.10 ... 891.20 903.80 937.00 916.30 834.50 614.10 592.70 758.60 744.60 636.30
4 CA ARTXD 0.49 0.64 0.64 0.69 1.47 1.62 1.60 1.70 ... 14.83 16.79 15.59 15.97 13.57 10.04 9.90 12.56 13.42 11.36
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
299 CA WWTXV 55.40 57.00 61.70 64.40 70.80 67.40 77.70 83.90 ... 366.10 343.30 409.30 410.50 190.40 163.30 171.50 188.80 215.50 198.10
300 CA WXICD 4.14 3.97 4.23 4.63 4.63 4.95 5.51 6.26 ... 35.56 34.62 33.37 33.91 32.88 32.66 32.69 32.94 29.79 26.87
301 CA WXICV 10.50 10.10 11.00 15.50 15.20 14.50 21.70 20.60 ... 70.50 69.60 74.20 67.60 54.80 56.60 44.10 54.20 41.20 32.80
302 CA ZWCDP 748.00 738.00 748.00 681.00 750.00 596.00 651.00 739.00 ... 774.00 1020.00 965.00 1175.00 1158.00 1024.00 1166.00 1102.00 894.00 1206.00
303 CA ZWHDP 3169.00 3690.00 3278.00 3396.00 3297.00 3609.00 3031.00 3050.00 ... 3182.00 2741.00 2707.00 2091.00 2342.00 2438.00 2442.00 2539.00 2946.00 2564.00

304 rows × 53 columns

Data Satatics¶

In [5]:
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 304 entries, 0 to 303
Data columns (total 53 columns):
 #   Column  Non-Null Count  Dtype  
---  ------  --------------  -----  
 0   State   304 non-null    object 
 1   MSN     304 non-null    object 
 2   1970    284 non-null    float64
 3   1971    284 non-null    float64
 4   1972    284 non-null    float64
 5   1973    284 non-null    float64
 6   1974    284 non-null    float64
 7   1975    284 non-null    float64
 8   1976    284 non-null    float64
 9   1977    284 non-null    float64
 10  1978    284 non-null    float64
 11  1979    284 non-null    float64
 12  1980    284 non-null    float64
 13  1981    284 non-null    float64
 14  1982    284 non-null    float64
 15  1983    284 non-null    float64
 16  1984    284 non-null    float64
 17  1985    284 non-null    float64
 18  1986    284 non-null    float64
 19  1987    284 non-null    float64
 20  1988    284 non-null    float64
 21  1989    284 non-null    float64
 22  1990    284 non-null    float64
 23  1991    284 non-null    float64
 24  1992    284 non-null    float64
 25  1993    280 non-null    float64
 26  1994    280 non-null    float64
 27  1995    280 non-null    float64
 28  1996    280 non-null    float64
 29  1997    283 non-null    float64
 30  1998    283 non-null    float64
 31  1999    283 non-null    float64
 32  2000    283 non-null    float64
 33  2001    283 non-null    float64
 34  2002    283 non-null    float64
 35  2003    283 non-null    float64
 36  2004    283 non-null    float64
 37  2005    283 non-null    float64
 38  2006    283 non-null    float64
 39  2007    283 non-null    float64
 40  2008    283 non-null    float64
 41  2009    283 non-null    float64
 42  2010    300 non-null    float64
 43  2011    300 non-null    float64
 44  2012    300 non-null    float64
 45  2013    300 non-null    float64
 46  2014    300 non-null    float64
 47  2015    300 non-null    float64
 48  2016    300 non-null    float64
 49  2017    300 non-null    float64
 50  2018    300 non-null    float64
 51  2019    300 non-null    float64
 52  2020    300 non-null    float64
dtypes: float64(51), object(2)
memory usage: 126.0+ KB
In [6]:
df.describe()
Out[6]:
1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 ... 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
count 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 2.840000e+02 ... 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02 3.000000e+02
mean 9.011960e+04 9.429002e+04 9.581337e+04 9.975289e+04 9.443671e+04 9.668779e+04 1.000583e+05 1.058091e+05 1.052697e+05 1.111674e+05 ... 1.269225e+05 1.261850e+05 1.279828e+05 1.270545e+05 1.289333e+05 1.301465e+05 1.326062e+05 1.345600e+05 1.352105e+05 1.195288e+05
std 4.455932e+05 4.663730e+05 4.742706e+05 4.898451e+05 4.605783e+05 4.732360e+05 4.900167e+05 5.219472e+05 5.213416e+05 5.446264e+05 ... 5.928098e+05 5.891410e+05 5.942789e+05 5.898692e+05 6.039160e+05 6.113764e+05 6.211631e+05 6.268406e+05 6.290843e+05 5.471620e+05
min 0.000000e+00 0.000000e+00 -1.000000e-01 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 ... 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00
25% 7.300000e-01 7.925000e-01 8.075000e-01 1.000000e+00 1.725000e+00 2.110000e+00 2.320000e+00 2.365000e+00 2.642500e+00 3.550000e+00 ... 2.162500e+01 1.679000e+01 1.609250e+01 1.597000e+01 1.163000e+01 1.034000e+01 1.194000e+01 1.481000e+01 1.342000e+01 1.025000e+01
50% 4.890000e+00 5.270000e+00 5.580000e+00 5.330000e+00 7.940000e+00 8.720000e+00 1.064500e+01 1.485000e+01 1.840000e+01 2.970000e+01 ... 4.640000e+01 4.377500e+01 5.430000e+01 5.805000e+01 5.195000e+01 5.004000e+01 4.950000e+01 5.775000e+01 6.017000e+01 4.744000e+01
75% 4.302250e+02 4.692750e+02 5.253250e+02 6.664500e+02 8.611000e+02 1.258050e+03 1.463650e+03 1.897400e+03 1.787400e+03 2.088600e+03 ... 6.959725e+03 5.292775e+03 8.987525e+03 9.074500e+03 6.001700e+03 5.310900e+03 6.788900e+03 8.436250e+03 8.251150e+03 6.458750e+03
max 4.472838e+06 4.668262e+06 4.765624e+06 4.911626e+06 4.530411e+06 4.658922e+06 4.831220e+06 5.243449e+06 5.083948e+06 5.415031e+06 ... 5.685695e+06 5.661024e+06 5.670996e+06 5.582047e+06 5.694129e+06 5.663687e+06 5.664659e+06 5.668087e+06 5.641205e+06 4.869977e+06

8 rows × 51 columns

In [7]:
# transposed_df = df.set_index(['Data_Status', 'State', 'MSN']).T.reset_index()
# # Convert the Timestamp column to datetime
# transposed_df['Timestamp'] = pd.to_datetime(transposed_df['Timestamp'])

After Transformation of Data¶

In [8]:
df# Assuming your DataFrame is called 'df'
df_trans = df.melt(id_vars=['State', 'MSN'], var_name='Year', value_name='Yearly Data')
# df['Year'] = pd.to_datetime(df['Year'], format='%Y')

# Set the 'State', 'MSN', and 'Year' columns as the index
df_trans.set_index(['State', 'MSN', 'Year'], inplace=True)

# Sort the index in ascending order
df_trans.sort_index(inplace=True)

# Print the resulting time series DataFrame
df_trans.reset_index(inplace=True)
df_trans['Year'] = pd.to_datetime(df_trans['Year'], format='%Y')

df_trans.head()
Out[8]:
State MSN Year Yearly Data
0 CA ARICD 1970-01-01 0.49
1 CA ARICD 1971-01-01 0.64
2 CA ARICD 1972-01-01 0.64
3 CA ARICD 1973-01-01 0.69
4 CA ARICD 1974-01-01 1.47

Modeling the Data¶

Using ARIMA Model¶

In [9]:
os.makedirs('Plots/Arima_results_plots',exist_ok=True)

for State in df_trans['State'].unique():
    for msn in df_trans['MSN'].unique():
        try:
            
            fig = go.Figure()

            print('State : {} and MSN : {}'.format(State,msn))
            # Get the energy consumption data for the current country and sector
            df_filter = df_trans[(df_trans['State'] == State) & (
                df_trans['MSN'] == msn)][['Year', 'Yearly Data']]
            df_filter_index = df_filter.set_index('Year')

            train_data = df_filter[:-5]
            test_data = df_filter[-5:]
            
            # Prepare the data for modeling
            years = df_filter_index.index
            energy_consumption = df_filter_index.values.flatten()

                    # Split the data into training and testing
            # Use all data except the last 5 years for training
            Horizan = -5
            train_data = energy_consumption[:Horizan]
            test_data = energy_consumption[Horizan:]  # Use the last 5 years for testing

            # Fit the auto ARIMA model
            model = auto_arima(train_data, seasonal=False)
            model.fit(train_data)

            # Generate predictions
            predictions = model.predict(n_periods=len(test_data))
            predictions_ahead_in_future = model.predict(n_periods=len(test_data)+15)

            # Calculate evaluation metrics
            mae = mean_absolute_error(test_data, predictions)
            mse = mean_squared_error(test_data, predictions)
            mape = np.mean(np.abs((test_data - predictions) / test_data)) * 100

            print('Mean Absolute Error (MAE):', np.round(mae,2))
            print('Mean Squared Error (MSE):', np.round(mse,2))
            print('Mean Absolute Percentage Error (MAPE):', np.round(mape,2))
            
            # Plot the training data
            fig.add_trace(go.Scatter(
                x=years[:Horizan], y=train_data, mode='lines+markers', name='Training Data'))

            # Plot the predictions
            fig.add_trace(go.Scatter(
                x=years[Horizan:], y=test_data, mode='lines+markers', name='Actual'))
            fig.add_trace(go.Scatter(
                x=years[Horizan:], y=predictions, mode='lines+markers', name='Predicted'))

            fig.add_trace(go.Scatter(
                x=pd.date_range(start = years[Horizan],periods=15,freq='Y'), y=predictions_ahead_in_future, mode='lines+markers', name='Prediction till 2030'))

            # Update the layout
            fig.update_layout(title=f'Energy Consumption Forecast State using ARIMA : {State} : MSN : {msn} ',
                            xaxis_title='Year', yaxis_title='Energy Consumption')

            # Show the plot
            fig.show()
            print(State,msn)
            fig.write_image(f'Plots/Arima_results_plots/{State}_{msn}.png')
            # break
        except:
            print('Error occoured in Combination State : {} and MSN : {} Due NaN Value'.format(State,mse))
State : CA and MSN : ARICD
Mean Absolute Error (MAE): 1.7
Mean Squared Error (MSE): 3.99
Mean Absolute Percentage Error (MAPE): 15.68
CA ARICD
State : CA and MSN : ARICV
Mean Absolute Error (MAE): 254.19
Mean Squared Error (MSE): 68574.32
Mean Absolute Percentage Error (MAPE): 39.24
CA ARICV
State : CA and MSN : ARTCD
Mean Absolute Error (MAE): 1.7
Mean Squared Error (MSE): 3.99
Mean Absolute Percentage Error (MAPE): 15.68
CA ARTCD
State : CA and MSN : ARTCV
Mean Absolute Error (MAE): 254.19
Mean Squared Error (MSE): 68574.32
Mean Absolute Percentage Error (MAPE): 39.24
CA ARTCV
State : CA and MSN : ARTXD
Mean Absolute Error (MAE): 1.7
Mean Squared Error (MSE): 3.99
Mean Absolute Percentage Error (MAPE): 15.68
CA ARTXD
State : CA and MSN : ARTXV
Mean Absolute Error (MAE): 254.19
Mean Squared Error (MSE): 68574.32
Mean Absolute Percentage Error (MAPE): 39.24
CA ARTXV
State : CA and MSN : AVACD
Mean Absolute Error (MAE): 1.88
Mean Squared Error (MSE): 4.53
Mean Absolute Percentage Error (MAPE): 8.03
CA AVACD
State : CA and MSN : AVACV
Mean Absolute Error (MAE): 11.86
Mean Squared Error (MSE): 198.7
Mean Absolute Percentage Error (MAPE): 20.67
CA AVACV
State : CA and MSN : AVTCD
Mean Absolute Error (MAE): 1.88
Mean Squared Error (MSE): 4.53
Mean Absolute Percentage Error (MAPE): 8.03
CA AVTCD
State : CA and MSN : AVTCV
Mean Absolute Error (MAE): 11.86
Mean Squared Error (MSE): 198.7
Mean Absolute Percentage Error (MAPE): 20.67
CA AVTCV
State : CA and MSN : AVTXD
Mean Absolute Error (MAE): 1.88
Mean Squared Error (MSE): 4.53
Mean Absolute Percentage Error (MAPE): 8.03
CA AVTXD
State : CA and MSN : AVTXV
Mean Absolute Error (MAE): 11.86
Mean Squared Error (MSE): 198.7
Mean Absolute Percentage Error (MAPE): 20.67
CA AVTXV
State : CA and MSN : CLACD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLACD
State : CA and MSN : CLACV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLACV
State : CA and MSN : CLCCD
Mean Absolute Error (MAE): 0.46
Mean Squared Error (MSE): 0.24
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA CLCCD
State : CA and MSN : CLCCV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA CLCCV
State : CA and MSN : CLEID
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLEID
State : CA and MSN : CLEIV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLEIV
State : CA and MSN : CLICD
Mean Absolute Error (MAE): 0.25
Mean Squared Error (MSE): 0.07
Mean Absolute Percentage Error (MAPE): 7.08
CA CLICD
State : CA and MSN : CLICV
Mean Absolute Error (MAE): 8.83
Mean Squared Error (MSE): 155.27
Mean Absolute Percentage Error (MAPE): 7.33
CA CLICV
State : CA and MSN : CLISB
Mean Absolute Error (MAE): 1821.8
Mean Squared Error (MSE): 4469817.4
Mean Absolute Percentage Error (MAPE): 5.82
CA CLISB
State : CA and MSN : CLKCD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLKCD
State : CA and MSN : CLKCV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLKCV
State : CA and MSN : CLOCD
Mean Absolute Error (MAE): 0.12
Mean Squared Error (MSE): 0.02
Mean Absolute Percentage Error (MAPE): 3.34
CA CLOCD
State : CA and MSN : CLOCV
Mean Absolute Error (MAE): 8.46
Mean Squared Error (MSE): 98.61
Mean Absolute Percentage Error (MAPE): 7.45
CA CLOCV
State : CA and MSN : CLOSB
Mean Absolute Error (MAE): 2803.27
Mean Squared Error (MSE): 9843655.25
Mean Absolute Percentage Error (MAPE): 8.65
CA CLOSB
State : CA and MSN : CLRCD
Mean Absolute Error (MAE): 1.13
Mean Squared Error (MSE): 1.43
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA CLRCD
State : CA and MSN : CLRCV
Mean Absolute Error (MAE): 0.27
Mean Squared Error (MSE): 0.08
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA CLRCV
State : CA and MSN : CLRFB
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA CLRFB
State : CA and MSN : CLSCB
Mean Absolute Error (MAE): 4584.35
Mean Squared Error (MSE): 36777898.59
Mean Absolute Percentage Error (MAPE): 15.39
CA CLSCB
State : CA and MSN : CLTCD
Mean Absolute Error (MAE): 0.35
Mean Squared Error (MSE): 0.16
Mean Absolute Percentage Error (MAPE): 10.0
CA CLTCD
State : CA and MSN : CLTCV
Mean Absolute Error (MAE): 8.46
Mean Squared Error (MSE): 98.61
Mean Absolute Percentage Error (MAPE): 7.45
CA CLTCV
State : CA and MSN : CLTXD
Mean Absolute Error (MAE): 0.25
Mean Squared Error (MSE): 0.07
Mean Absolute Percentage Error (MAPE): 7.03
CA CLTXD
State : CA and MSN : CLTXV
Mean Absolute Error (MAE): 8.66
Mean Squared Error (MSE): 152.71
Mean Absolute Percentage Error (MAPE): 7.18
CA CLTXV
State : CA and MSN : DFACD
Mean Absolute Error (MAE): 3.72
Mean Squared Error (MSE): 19.47
Mean Absolute Percentage Error (MAPE): 14.3
CA DFACD
State : CA and MSN : DFACV
Mean Absolute Error (MAE): 1919.54
Mean Squared Error (MSE): 5388374.74
Mean Absolute Percentage Error (MAPE): 15.5
CA DFACV
State : CA and MSN : DFCCD
Mean Absolute Error (MAE): 2.31
Mean Squared Error (MSE): 6.79
Mean Absolute Percentage Error (MAPE): 14.8
CA DFCCD
State : CA and MSN : DFCCV
Mean Absolute Error (MAE): 59.28
Mean Squared Error (MSE): 4821.16
Mean Absolute Percentage Error (MAPE): 22.45
CA DFCCV
State : CA and MSN : DFEID
Mean Absolute Error (MAE): 3.02
Mean Squared Error (MSE): 12.67
Mean Absolute Percentage Error (MAPE): 19.88
CA DFEID
State : CA and MSN : DFEIV
Mean Absolute Error (MAE): 4.09
Mean Squared Error (MSE): 18.7
Mean Absolute Percentage Error (MAPE): 76.06
CA DFEIV
State : CA and MSN : DFICD
Mean Absolute Error (MAE): 2.32
Mean Squared Error (MSE): 6.57
Mean Absolute Percentage Error (MAPE): 14.99
CA DFICD
State : CA and MSN : DFICV
Mean Absolute Error (MAE): 577.65
Mean Squared Error (MSE): 380916.81
Mean Absolute Percentage Error (MAPE): 58.96
CA DFICV
State : CA and MSN : DFISB
Mean Absolute Error (MAE): 10437.52
Mean Squared Error (MSE): 141936422.79
Mean Absolute Percentage Error (MAPE): 15.69
CA DFISB
State : CA and MSN : DFRCD
Mean Absolute Error (MAE): 2.09
Mean Squared Error (MSE): 5.05
Mean Absolute Percentage Error (MAPE): 11.07
CA DFRCD
State : CA and MSN : DFRCV
Mean Absolute Error (MAE): 4.48
Mean Squared Error (MSE): 21.45
Mean Absolute Percentage Error (MAPE): 54.12
CA DFRCV
State : CA and MSN : DFRFB
Mean Absolute Error (MAE): 198.32
Mean Squared Error (MSE): 47029.57
Mean Absolute Percentage Error (MAPE): 40.51
CA DFRFB
State : CA and MSN : DFSCB
Mean Absolute Error (MAE): 27305.47
Mean Squared Error (MSE): 1394074741.57
Mean Absolute Percentage Error (MAPE): 5.01
CA DFSCB
State : CA and MSN : DFTCD
Mean Absolute Error (MAE): 3.44
Mean Squared Error (MSE): 17.03
Mean Absolute Percentage Error (MAPE): 14.04
CA DFTCD
State : CA and MSN : DFTCV
Mean Absolute Error (MAE): 1900.58
Mean Squared Error (MSE): 5683211.77
Mean Absolute Percentage Error (MAPE): 13.67
CA DFTCV
State : CA and MSN : DFTXD
Mean Absolute Error (MAE): 3.44
Mean Squared Error (MSE): 17.0
Mean Absolute Percentage Error (MAPE): 14.02
CA DFTXD
State : CA and MSN : DFTXV
Mean Absolute Error (MAE): 1899.56
Mean Squared Error (MSE): 5677855.97
Mean Absolute Percentage Error (MAPE): 13.67
CA DFTXV
State : CA and MSN : DKEID
Mean Absolute Error (MAE): 3.02
Mean Squared Error (MSE): 12.67
Mean Absolute Percentage Error (MAPE): 19.88
CA DKEID
State : CA and MSN : DKEIV
Mean Absolute Error (MAE): 5.05
Mean Squared Error (MSE): 30.52
Mean Absolute Percentage Error (MAPE): 93.03
CA DKEIV
State : CA and MSN : ELEXD
Mean Absolute Error (MAE): 2.33
Mean Squared Error (MSE): 7.88
Mean Absolute Percentage Error (MAPE): 38.26
CA ELEXD
State : CA and MSN : ELEXV
Mean Absolute Error (MAE): 51.36
Mean Squared Error (MSE): 5867.1
Mean Absolute Percentage Error (MAPE): 65.77
CA ELEXV
State : CA and MSN : ELIMD
Mean Absolute Error (MAE): 1.37
Mean Squared Error (MSE): 2.32
Mean Absolute Percentage Error (MAPE): 15.52
CA ELIMD
State : CA and MSN : ELIMV
Mean Absolute Error (MAE): 205.61
Mean Squared Error (MSE): 64446.4
Mean Absolute Percentage Error (MAPE): 118.63
CA ELIMV
State : CA and MSN : EMACV
Error occoured in Combination State : CA and MSN : 64446.39978843976 Due NaN Value
State : CA and MSN : EMCCV
Error occoured in Combination State : CA and MSN : 64446.39978843976 Due NaN Value
State : CA and MSN : EMICV
Error occoured in Combination State : CA and MSN : 64446.39978843976 Due NaN Value
State : CA and MSN : EMTCV
Error occoured in Combination State : CA and MSN : 64446.39978843976 Due NaN Value
State : CA and MSN : ESACD
Mean Absolute Error (MAE): 1.85
Mean Squared Error (MSE): 3.94
Mean Absolute Percentage Error (MAPE): 7.02
CA ESACD
State : CA and MSN : ESACV
Mean Absolute Error (MAE): 11.68
Mean Squared Error (MSE): 196.99
Mean Absolute Percentage Error (MAPE): 18.06
CA ESACV
State : CA and MSN : ESCCD
Mean Absolute Error (MAE): 1.17
Mean Squared Error (MSE): 1.88
Mean Absolute Percentage Error (MAPE): 2.51
CA ESCCD
State : CA and MSN : ESCCV
Mean Absolute Error (MAE): 1244.64
Mean Squared Error (MSE): 1684633.44
Mean Absolute Percentage Error (MAPE): 6.72
CA ESCCV
State : CA and MSN : ESICD
Mean Absolute Error (MAE): 1.39
Mean Squared Error (MSE): 2.57
Mean Absolute Percentage Error (MAPE): 3.53
CA ESICD
State : CA and MSN : ESICV
Mean Absolute Error (MAE): 404.67
Mean Squared Error (MSE): 176126.33
Mean Absolute Percentage Error (MAPE): 6.74
CA ESICV
State : CA and MSN : ESISB
Mean Absolute Error (MAE): 10433.45
Mean Squared Error (MSE): 119021409.6
Mean Absolute Percentage Error (MAPE): 6.65
CA ESISB
State : CA and MSN : ESRCD
Mean Absolute Error (MAE): 2.5
Mean Squared Error (MSE): 8.93
Mean Absolute Percentage Error (MAPE): 4.38
CA ESRCD
State : CA and MSN : ESRCV
Mean Absolute Error (MAE): 875.95
Mean Squared Error (MSE): 1573149.88
Mean Absolute Percentage Error (MAPE): 4.83
CA ESRCV
State : CA and MSN : ESRFB
Mean Absolute Error (MAE): 1879.01
Mean Squared Error (MSE): 4576051.03
Mean Absolute Percentage Error (MAPE): 22.0
CA ESRFB
State : CA and MSN : ESSCB
Mean Absolute Error (MAE): 57265.0
Mean Squared Error (MSE): 3895964468.84
Mean Absolute Percentage Error (MAPE): 6.71
CA ESSCB
State : CA and MSN : ESTCD
Mean Absolute Error (MAE): 1.2
Mean Squared Error (MSE): 2.49
Mean Absolute Percentage Error (MAPE): 2.41
CA ESTCD
State : CA and MSN : ESTCV
Mean Absolute Error (MAE): 1032.26
Mean Squared Error (MSE): 1425054.18
Mean Absolute Percentage Error (MAPE): 2.53
CA ESTCV
State : CA and MSN : ESTXD
Mean Absolute Error (MAE): 1.2
Mean Squared Error (MSE): 2.49
Mean Absolute Percentage Error (MAPE): 2.41
CA ESTXD
State : CA and MSN : ESTXV
Mean Absolute Error (MAE): 1032.26
Mean Squared Error (MSE): 1425054.18
Mean Absolute Percentage Error (MAPE): 2.53
CA ESTXV
State : CA and MSN : FNICD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA FNICD
State : CA and MSN : FNICV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA FNICV
State : CA and MSN : FOICD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

CA FOICD
State : CA and MSN : FOICV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA FOICV
State : CA and MSN : FSICD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA FSICD
State : CA and MSN : FSICV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA FSICV
State : CA and MSN : GDPRV
Error occoured in Combination State : CA and MSN : 0.0 Due NaN Value
State : CA and MSN : GDPRX
Error occoured in Combination State : CA and MSN : 0.0 Due NaN Value
State : CA and MSN : HLACD
Mean Absolute Error (MAE): 3.55
Mean Squared Error (MSE): 20.01
Mean Absolute Percentage Error (MAPE): 19.57
CA HLACD
State : CA and MSN : HLACV
Mean Absolute Error (MAE): 8.0
Mean Squared Error (MSE): 98.98
Mean Absolute Percentage Error (MAPE): 109.36
CA HLACV
State : CA and MSN : HLCCD
Mean Absolute Error (MAE): 1.77
Mean Squared Error (MSE): 7.99
Mean Absolute Percentage Error (MAPE): 10.72
CA HLCCD
State : CA and MSN : HLCCV
Mean Absolute Error (MAE): 32.99
Mean Squared Error (MSE): 2074.7
Mean Absolute Percentage Error (MAPE): 15.34
CA HLCCV
State : CA and MSN : HLICD
Mean Absolute Error (MAE): 4.0
Mean Squared Error (MSE): 31.81
Mean Absolute Percentage Error (MAPE): 20.47
CA HLICD
State : CA and MSN : HLICV
Mean Absolute Error (MAE): 46.56
Mean Squared Error (MSE): 3680.7
Mean Absolute Percentage Error (MAPE): 11.42
CA HLICV
State : CA and MSN : HLISB
Mean Absolute Error (MAE): 1137.0
Mean Squared Error (MSE): 1662693.8
Mean Absolute Percentage Error (MAPE): 5.76
CA HLISB
State : CA and MSN : HLRCD
Mean Absolute Error (MAE): 3.88
Mean Squared Error (MSE): 21.59
Mean Absolute Percentage Error (MAPE): 15.25
CA HLRCD
State : CA and MSN : HLRCV
Mean Absolute Error (MAE): 84.16
Mean Squared Error (MSE): 11312.86
Mean Absolute Percentage Error (MAPE): 12.11
CA HLRCV
State : CA and MSN : HLRFB
Mean Absolute Error (MAE): 818.0
Mean Squared Error (MSE): 724329.2
Mean Absolute Percentage Error (MAPE): 53.68
CA HLRFB
State : CA and MSN : HLSCB
Mean Absolute Error (MAE): 4849.11
Mean Squared Error (MSE): 26697958.3
Mean Absolute Percentage Error (MAPE): 8.46
CA HLSCB
State : CA and MSN : HLTCD
Mean Absolute Error (MAE): 3.13
Mean Squared Error (MSE): 18.11
Mean Absolute Percentage Error (MAPE): 13.82
CA HLTCD
State : CA and MSN : HLTCV
Mean Absolute Error (MAE): 181.37
Mean Squared Error (MSE): 65332.27
Mean Absolute Percentage Error (MAPE): 13.66
CA HLTCV
State : CA and MSN : HLTXD
Mean Absolute Error (MAE): 3.13
Mean Squared Error (MSE): 18.11
Mean Absolute Percentage Error (MAPE): 13.82
CA HLTXD
State : CA and MSN : HLTXV
Mean Absolute Error (MAE): 181.37
Mean Squared Error (MSE): 65332.27
Mean Absolute Percentage Error (MAPE): 13.66
CA HLTXV
State : CA and MSN : JFACD
Mean Absolute Error (MAE): 2.2
Mean Squared Error (MSE): 5.99
Mean Absolute Percentage Error (MAPE): 17.96
CA JFACD
State : CA and MSN : JFACV
Mean Absolute Error (MAE): 1988.42
Mean Squared Error (MSE): 4943337.72
Mean Absolute Percentage Error (MAPE): 34.39
CA JFACV
State : CA and MSN : JFTCD
Mean Absolute Error (MAE): 2.2
Mean Squared Error (MSE): 5.99
Mean Absolute Percentage Error (MAPE): 17.96
CA JFTCD
State : CA and MSN : JFTCV
Mean Absolute Error (MAE): 1988.42
Mean Squared Error (MSE): 4943337.72
Mean Absolute Percentage Error (MAPE): 34.39
CA JFTCV
State : CA and MSN : JFTXD
Mean Absolute Error (MAE): 2.2
Mean Squared Error (MSE): 5.99
Mean Absolute Percentage Error (MAPE): 17.96
CA JFTXD
State : CA and MSN : JFTXV
Mean Absolute Error (MAE): 1988.42
Mean Squared Error (MSE): 4943337.72
Mean Absolute Percentage Error (MAPE): 34.39
CA JFTXV
State : CA and MSN : KSCCD
Mean Absolute Error (MAE): 3.84
Mean Squared Error (MSE): 21.64
Mean Absolute Percentage Error (MAPE): 19.31
CA KSCCD
State : CA and MSN : KSCCV
Mean Absolute Error (MAE): 0.4
Mean Squared Error (MSE): 0.22
Mean Absolute Percentage Error (MAPE): 39.36
CA KSCCV
State : CA and MSN : KSICD
Mean Absolute Error (MAE): 2.84
Mean Squared Error (MSE): 10.21
Mean Absolute Percentage Error (MAPE): 18.38
CA KSICD
State : CA and MSN : KSICV
Mean Absolute Error (MAE): 0.44
Mean Squared Error (MSE): 0.46
Mean Absolute Percentage Error (MAPE): 288.2
CA KSICV
State : CA and MSN : KSRCD
Mean Absolute Error (MAE): 3.84
Mean Squared Error (MSE): 21.64
Mean Absolute Percentage Error (MAPE): 19.31
CA KSRCD
State : CA and MSN : KSRCV
Mean Absolute Error (MAE): 2.58
Mean Squared Error (MSE): 9.16
Mean Absolute Percentage Error (MAPE): 34.37
CA KSRCV
State : CA and MSN : KSTCD
Mean Absolute Error (MAE): 3.83
Mean Squared Error (MSE): 21.62
Mean Absolute Percentage Error (MAPE): 19.32
CA KSTCD
State : CA and MSN : KSTCV
Mean Absolute Error (MAE): 5.31
Mean Squared Error (MSE): 35.67
Mean Absolute Percentage Error (MAPE): 69.83
CA KSTCV
State : CA and MSN : KSTXD
Mean Absolute Error (MAE): 3.83
Mean Squared Error (MSE): 21.62
Mean Absolute Percentage Error (MAPE): 19.32
CA KSTXD
State : CA and MSN : KSTXV
Mean Absolute Error (MAE): 5.31
Mean Squared Error (MSE): 35.67
Mean Absolute Percentage Error (MAPE): 69.83
CA KSTXV
State : CA and MSN : LUACD
Mean Absolute Error (MAE): 2.39
Mean Squared Error (MSE): 7.0
Mean Absolute Percentage Error (MAPE): 3.29
CA LUACD
State : CA and MSN : LUACV
Mean Absolute Error (MAE): 192.71
Mean Squared Error (MSE): 45041.24
Mean Absolute Percentage Error (MAPE): 21.76
CA LUACV
State : CA and MSN : LUICD
Mean Absolute Error (MAE): 2.39
Mean Squared Error (MSE): 7.0
Mean Absolute Percentage Error (MAPE): 3.29
CA LUICD
State : CA and MSN : LUICV
Mean Absolute Error (MAE): 77.75
Mean Squared Error (MSE): 6905.58
Mean Absolute Percentage Error (MAPE): 10.11
CA LUICV
State : CA and MSN : LUTCD
Mean Absolute Error (MAE): 2.39
Mean Squared Error (MSE): 7.0
Mean Absolute Percentage Error (MAPE): 3.29
CA LUTCD
State : CA and MSN : LUTCV
Mean Absolute Error (MAE): 270.46
Mean Squared Error (MSE): 86707.62
Mean Absolute Percentage Error (MAPE): 16.29
CA LUTCV
State : CA and MSN : LUTXD
Mean Absolute Error (MAE): 2.39
Mean Squared Error (MSE): 7.0
Mean Absolute Percentage Error (MAPE): 3.29
CA LUTXD
State : CA and MSN : LUTXV
Mean Absolute Error (MAE): 270.46
Mean Squared Error (MSE): 86707.62
Mean Absolute Percentage Error (MAPE): 16.29
CA LUTXV
State : CA and MSN : MGACD
Mean Absolute Error (MAE): 2.4
Mean Squared Error (MSE): 6.84
Mean Absolute Percentage Error (MAPE): 9.81
CA MGACD
State : CA and MSN : MGACV
Mean Absolute Error (MAE): 5773.27
Mean Squared Error (MSE): 53630609.65
Mean Absolute Percentage Error (MAPE): 15.08
CA MGACV
State : CA and MSN : MGCCD
Mean Absolute Error (MAE): 2.4
Mean Squared Error (MSE): 6.84
Mean Absolute Percentage Error (MAPE): 9.81
CA MGCCD
State : CA and MSN : MGCCV
Mean Absolute Error (MAE): 1267.82
Mean Squared Error (MSE): 1630147.88
Mean Absolute Percentage Error (MAPE): 94.54
CA MGCCV
State : CA and MSN : MGICD
Mean Absolute Error (MAE): 2.4
Mean Squared Error (MSE): 6.84
Mean Absolute Percentage Error (MAPE): 9.81
CA MGICD
State : CA and MSN : MGICV
Mean Absolute Error (MAE): 72.9
Mean Squared Error (MSE): 7797.95
Mean Absolute Percentage Error (MAPE): 9.16
CA MGICV
State : CA and MSN : MGTCD
Mean Absolute Error (MAE): 2.4
Mean Squared Error (MSE): 6.84
Mean Absolute Percentage Error (MAPE): 9.81
CA MGTCD
State : CA and MSN : MGTCV
Mean Absolute Error (MAE): 5977.49
Mean Squared Error (MSE): 56171615.85
Mean Absolute Percentage Error (MAPE): 14.77
CA MGTCV
State : CA and MSN : MGTPV
Mean Absolute Error (MAE): 152.69
Mean Squared Error (MSE): 37880.91
Mean Absolute Percentage Error (MAPE): 14.97
CA MGTPV
State : CA and MSN : MGTXD
Mean Absolute Error (MAE): 2.4
Mean Squared Error (MSE): 6.84
Mean Absolute Percentage Error (MAPE): 9.81
CA MGTXD
State : CA and MSN : MGTXV
Mean Absolute Error (MAE): 5977.49
Mean Squared Error (MSE): 56171615.85
Mean Absolute Percentage Error (MAPE): 14.77
CA MGTXV
State : CA and MSN : MSICD
Mean Absolute Error (MAE): 2.93
Mean Squared Error (MSE): 10.61
Mean Absolute Percentage Error (MAPE): 17.7
CA MSICD
State : CA and MSN : MSICV
Mean Absolute Error (MAE): 22.74
Mean Squared Error (MSE): 736.96
Mean Absolute Percentage Error (MAPE): 33.82
CA MSICV
State : CA and MSN : NGACD
Mean Absolute Error (MAE): 0.48
Mean Squared Error (MSE): 0.31
Mean Absolute Percentage Error (MAPE): 5.7
CA NGACD
State : CA and MSN : NGACV
Mean Absolute Error (MAE): 42.49
Mean Squared Error (MSE): 2319.99
Mean Absolute Percentage Error (MAPE): 19.42
CA NGACV
State : CA and MSN : NGASB
Mean Absolute Error (MAE): 2609.13
Mean Squared Error (MSE): 10744583.23
Mean Absolute Percentage Error (MAPE): 9.97
CA NGASB
State : CA and MSN : NGCCD
Mean Absolute Error (MAE): 0.76
Mean Squared Error (MSE): 0.83
Mean Absolute Percentage Error (MAPE): 8.42
CA NGCCD
State : CA and MSN : NGCCV
Mean Absolute Error (MAE): 75.25
Mean Squared Error (MSE): 13981.47
Mean Absolute Percentage Error (MAPE): 3.24
CA NGCCV
State : CA and MSN : NGEID
Mean Absolute Error (MAE): 0.47
Mean Squared Error (MSE): 0.29
Mean Absolute Percentage Error (MAPE): 13.34
CA NGEID
State : CA and MSN : NGEIV
Mean Absolute Error (MAE): 1052.16
Mean Squared Error (MSE): 1188493.81
Mean Absolute Percentage Error (MAPE): 47.77
CA NGEIV
State : CA and MSN : NGICD
Mean Absolute Error (MAE): 0.82
Mean Squared Error (MSE): 0.78
Mean Absolute Percentage Error (MAPE): 11.53
CA NGICD
State : CA and MSN : NGICV
Mean Absolute Error (MAE): 307.06
Mean Squared Error (MSE): 141212.61
Mean Absolute Percentage Error (MAPE): 6.81
CA NGICV
State : CA and MSN : NGISB
Mean Absolute Error (MAE): 31877.8
Mean Squared Error (MSE): 2068623147.0
Mean Absolute Percentage Error (MAPE): 5.41
CA NGISB
State : CA and MSN : NGLPB
Mean Absolute Error (MAE): 12794.19
Mean Squared Error (MSE): 187676047.03
Mean Absolute Percentage Error (MAPE): 31.63
CA NGLPB
State : CA and MSN : NGPZB
Mean Absolute Error (MAE): 3041.4
Mean Squared Error (MSE): 11776586.2
Mean Absolute Percentage Error (MAPE): 14.02
CA NGPZB
State : CA and MSN : NGRCD
Mean Absolute Error (MAE): 0.67
Mean Squared Error (MSE): 0.69
Mean Absolute Percentage Error (MAPE): 5.26
CA NGRCD
State : CA and MSN : NGRCV
Mean Absolute Error (MAE): 666.0
Mean Squared Error (MSE): 653844.18
Mean Absolute Percentage Error (MAPE): 11.2
CA NGRCV
State : CA and MSN : NGRFB
Mean Absolute Error (MAE): 2075.46
Mean Squared Error (MSE): 7222604.39
Mean Absolute Percentage Error (MAPE): 1.36
CA NGRFB
State : CA and MSN : NGSCB
Mean Absolute Error (MAE): 182998.0
Mean Squared Error (MSE): 34469733075.6
Mean Absolute Percentage Error (MAPE): 9.24
CA NGSCB
State : CA and MSN : NGTCD
Mean Absolute Error (MAE): 0.91
Mean Squared Error (MSE): 1.03
Mean Absolute Percentage Error (MAPE): 12.02
CA NGTCD
State : CA and MSN : NGTCV
Mean Absolute Error (MAE): 781.39
Mean Squared Error (MSE): 801412.95
Mean Absolute Percentage Error (MAPE): 5.27
CA NGTCV
State : CA and MSN : NGTXD
Mean Absolute Error (MAE): 0.4
Mean Squared Error (MSE): 0.29
Mean Absolute Percentage Error (MAPE): 4.17
CA NGTXD
State : CA and MSN : NGTXV
Mean Absolute Error (MAE): 623.5
Mean Squared Error (MSE): 648774.15
Mean Absolute Percentage Error (MAPE): 4.82
CA NGTXV
State : CA and MSN : NUEGD
Mean Absolute Error (MAE): 0.11
Mean Squared Error (MSE): 0.01
Mean Absolute Percentage Error (MAPE): 17.08
CA NUEGD
State : CA and MSN : NUEGV
Mean Absolute Error (MAE): 6.94
Mean Squared Error (MSE): 88.9
Mean Absolute Percentage Error (MAPE): 6.09
CA NUEGV
State : CA and MSN : NUETD
Mean Absolute Error (MAE): 0.11
Mean Squared Error (MSE): 0.01
Mean Absolute Percentage Error (MAPE): 17.08
CA NUETD
State : CA and MSN : NUETV
Mean Absolute Error (MAE): 6.94
Mean Squared Error (MSE): 88.9
Mean Absolute Percentage Error (MAPE): 6.09
CA NUETV
State : CA and MSN : OHICD
Error occoured in Combination State : CA and MSN : 88.89800000000005 Due NaN Value
State : CA and MSN : OHICV
Error occoured in Combination State : CA and MSN : 88.89800000000005 Due NaN Value
State : CA and MSN : OPICD
Mean Absolute Error (MAE): 1.95
Mean Squared Error (MSE): 5.08
Mean Absolute Percentage Error (MAPE): 9.66
CA OPICD
State : CA and MSN : OPICV
Mean Absolute Error (MAE): 29.83
Mean Squared Error (MSE): 1083.98
Mean Absolute Percentage Error (MAPE): 13.72
CA OPICV
State : CA and MSN : OPISB
Mean Absolute Error (MAE): 507.0
Mean Squared Error (MSE): 319093.8
Mean Absolute Percentage Error (MAPE): 4.89
CA OPISB
State : CA and MSN : OPSCB
Mean Absolute Error (MAE): 507.0
Mean Squared Error (MSE): 319093.8
Mean Absolute Percentage Error (MAPE): 4.89
CA OPSCB
State : CA and MSN : OPTCD
Mean Absolute Error (MAE): 1.95
Mean Squared Error (MSE): 5.08
Mean Absolute Percentage Error (MAPE): 9.66
CA OPTCD
State : CA and MSN : OPTCV
Mean Absolute Error (MAE): 29.83
Mean Squared Error (MSE): 1083.98
Mean Absolute Percentage Error (MAPE): 13.72
CA OPTCV
State : CA and MSN : OPTXD
Mean Absolute Error (MAE): 1.95
Mean Squared Error (MSE): 5.08
Mean Absolute Percentage Error (MAPE): 9.66
CA OPTXD
State : CA and MSN : OPTXV
Mean Absolute Error (MAE): 29.83
Mean Squared Error (MSE): 1083.98
Mean Absolute Percentage Error (MAPE): 13.72
CA OPTXV
State : CA and MSN : P1ICD
Mean Absolute Error (MAE): 2.2
Mean Squared Error (MSE): 5.68
Mean Absolute Percentage Error (MAPE): 10.59
CA P1ICD
State : CA and MSN : P1ICV
Mean Absolute Error (MAE): 307.33
Mean Squared Error (MSE): 107497.02
Mean Absolute Percentage Error (MAPE): 18.97
CA P1ICV
State : CA and MSN : P1ISB
Mean Absolute Error (MAE): 3912.4
Mean Squared Error (MSE): 24062088.4
Mean Absolute Percentage Error (MAPE): 5.04
CA P1ISB
State : CA and MSN : P1SCB
Mean Absolute Error (MAE): 29898.27
Mean Squared Error (MSE): 1081859809.44
Mean Absolute Percentage Error (MAPE): 31.99
CA P1SCB
State : CA and MSN : P1TCD
Mean Absolute Error (MAE): 2.1
Mean Squared Error (MSE): 6.73
Mean Absolute Percentage Error (MAPE): 7.7
CA P1TCD
State : CA and MSN : P1TCV
Mean Absolute Error (MAE): 509.18
Mean Squared Error (MSE): 297006.22
Mean Absolute Percentage Error (MAPE): 19.75
CA P1TCV
State : CA and MSN : P1TXD
Mean Absolute Error (MAE): 2.1
Mean Squared Error (MSE): 6.27
Mean Absolute Percentage Error (MAPE): 7.77
CA P1TXD
State : CA and MSN : P1TXV
Mean Absolute Error (MAE): 509.18
Mean Squared Error (MSE): 297006.22
Mean Absolute Percentage Error (MAPE): 19.75
CA P1TXV
State : CA and MSN : P5RFB
Mean Absolute Error (MAE): 12060.8
Mean Squared Error (MSE): 159316599.6
Mean Absolute Percentage Error (MAPE): 7.2
CA P5RFB
State : CA and MSN : PAACD
Mean Absolute Error (MAE): 2.15
Mean Squared Error (MSE): 6.27
Mean Absolute Percentage Error (MAPE): 9.57
CA PAACD
State : CA and MSN : PAACV
Mean Absolute Error (MAE): 9359.64
Mean Squared Error (MSE): 116203233.36
Mean Absolute Percentage Error (MAPE): 15.69
CA PAACV
State : CA and MSN : PACCD
Mean Absolute Error (MAE): 2.22
Mean Squared Error (MSE): 7.25
Mean Absolute Percentage Error (MAPE): 10.94
CA PACCD
State : CA and MSN : PACCV
Mean Absolute Error (MAE): 205.52
Mean Squared Error (MSE): 68041.17
Mean Absolute Percentage Error (MAPE): 10.52
CA PACCV
State : CA and MSN : PAEID
Mean Absolute Error (MAE): 4.05
Mean Squared Error (MSE): 20.92
Mean Absolute Percentage Error (MAPE): 26.99
CA PAEID
State : CA and MSN : PAEIV
Mean Absolute Error (MAE): 17.98
Mean Squared Error (MSE): 323.76
Mean Absolute Percentage Error (MAPE): 339.24
CA PAEIV
State : CA and MSN : PAICD
Mean Absolute Error (MAE): 2.01
Mean Squared Error (MSE): 5.16
Mean Absolute Percentage Error (MAPE): 10.89
CA PAICD
State : CA and MSN : PAICV
Mean Absolute Error (MAE): 390.48
Mean Squared Error (MSE): 224686.96
Mean Absolute Percentage Error (MAPE): 10.68
CA PAICV
State : CA and MSN : PAISB
Mean Absolute Error (MAE): 13561.6
Mean Squared Error (MSE): 265144206.0
Mean Absolute Percentage Error (MAPE): 6.96
CA PAISB
State : CA and MSN : PARCD
Mean Absolute Error (MAE): 4.28
Mean Squared Error (MSE): 28.09
Mean Absolute Percentage Error (MAPE): 17.12
CA PARCD
State : CA and MSN : PARCV
Mean Absolute Error (MAE): 86.36
Mean Squared Error (MSE): 11995.48
Mean Absolute Percentage Error (MAPE): 12.12
CA PARCV
State : CA and MSN : PASCB
Mean Absolute Error (MAE): 234462.8
Mean Squared Error (MSE): 78729393216.4
Mean Absolute Percentage Error (MAPE): 7.98
CA PASCB
State : CA and MSN : PATCD
Mean Absolute Error (MAE): 2.23
Mean Squared Error (MSE): 5.67
Mean Absolute Percentage Error (MAPE): 10.46
CA PATCD
State : CA and MSN : PATCV
Mean Absolute Error (MAE): 10001.23
Mean Squared Error (MSE): 132830961.3
Mean Absolute Percentage Error (MAPE): 15.24
CA PATCV
State : CA and MSN : PATXD
Mean Absolute Error (MAE): 2.14
Mean Squared Error (MSE): 6.11
Mean Absolute Percentage Error (MAPE): 9.57
CA PATXD
State : CA and MSN : PATXV
Mean Absolute Error (MAE): 10001.04
Mean Squared Error (MSE): 132845671.5
Mean Absolute Percentage Error (MAPE): 15.24
CA PATXV
State : CA and MSN : PCCCD
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCCCD
State : CA and MSN : PCCCV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/home/iffi/anaconda3/envs/sep_darts_2/lib/python3.11/site-packages/pmdarima/arima/auto.py:444: UserWarning:

Input time-series is completely constant; returning a (0, 0, 0) ARMA.

/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCCCV
State : CA and MSN : PCEID
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCEID
State : CA and MSN : PCEIV
Mean Absolute Error (MAE): 0.0
Mean Squared Error (MSE): 0.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCEIV
State : CA and MSN : PCICD
Mean Absolute Error (MAE): 0.44
Mean Squared Error (MSE): 0.48
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCICD
State : CA and MSN : PCICV
Mean Absolute Error (MAE): 0.97
Mean Squared Error (MSE): 3.35
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCICV
State : CA and MSN : PCISB
Mean Absolute Error (MAE): 484.27
Mean Squared Error (MSE): 1170721.59
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCISB
State : CA and MSN : PCRFB
Mean Absolute Error (MAE): 9083.4
Mean Squared Error (MSE): 109537385.0
Mean Absolute Percentage Error (MAPE): 14.2
CA PCRFB
State : CA and MSN : PCSCB
Mean Absolute Error (MAE): 484.0
Mean Squared Error (MSE): 1171280.0
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCSCB
State : CA and MSN : PCTCD
Mean Absolute Error (MAE): 0.32
Mean Squared Error (MSE): 0.5
Mean Absolute Percentage Error (MAPE): nan
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

invalid value encountered in divide

CA PCTCD
State : CA and MSN : PCTCV
Mean Absolute Error (MAE): 0.76
Mean Squared Error (MSE): 2.89
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCTCV
State : CA and MSN : PCTXD
Mean Absolute Error (MAE): 0.44
Mean Squared Error (MSE): 0.48
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCTXD
State : CA and MSN : PCTXV
Mean Absolute Error (MAE): 0.97
Mean Squared Error (MSE): 3.35
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA PCTXV
State : CA and MSN : PEACD
Mean Absolute Error (MAE): 2.14
Mean Squared Error (MSE): 6.13
Mean Absolute Percentage Error (MAPE): 9.56
CA PEACD
State : CA and MSN : PEACV
Mean Absolute Error (MAE): 9362.87
Mean Squared Error (MSE): 116264624.49
Mean Absolute Percentage Error (MAPE): 15.63
CA PEACV
State : CA and MSN : PEASB
Mean Absolute Error (MAE): 212796.29
Mean Squared Error (MSE): 87854943137.53
Mean Absolute Percentage Error (MAPE): 8.28
CA PEASB
State : CA and MSN : PECCD
Mean Absolute Error (MAE): 0.63
Mean Squared Error (MSE): 0.5
Mean Absolute Percentage Error (MAPE): 5.25
CA PECCD
State : CA and MSN : PECCV
Mean Absolute Error (MAE): 404.97
Mean Squared Error (MSE): 246490.9
Mean Absolute Percentage Error (MAPE): 9.54
CA PECCV
State : CA and MSN : PECSB
Mean Absolute Error (MAE): 35670.53
Mean Squared Error (MSE): 1604596203.21
Mean Absolute Percentage Error (MAPE): 10.21
CA PECSB
State : CA and MSN : PEEID
Mean Absolute Error (MAE): 0.28
Mean Squared Error (MSE): 0.11
Mean Absolute Percentage Error (MAPE): 8.67
CA PEEID
State : CA and MSN : PEEIV
Mean Absolute Error (MAE): 1237.59
Mean Squared Error (MSE): 1650669.04
Mean Absolute Percentage Error (MAPE): 44.83
CA PEEIV
State : CA and MSN : PEICD
Mean Absolute Error (MAE): 0.86
Mean Squared Error (MSE): 0.97
Mean Absolute Percentage Error (MAPE): 9.29
CA PEICD
State : CA and MSN : PEICV
Mean Absolute Error (MAE): 1282.37
Mean Squared Error (MSE): 2021647.25
Mean Absolute Percentage Error (MAPE): 15.68
CA PEICV
State : CA and MSN : PEISB
Mean Absolute Error (MAE): 29790.23
Mean Squared Error (MSE): 1849291764.27
Mean Absolute Percentage Error (MAPE): 3.52
CA PEISB
State : CA and MSN : PERCD
Mean Absolute Error (MAE): 0.4
Mean Squared Error (MSE): 0.26
Mean Absolute Percentage Error (MAPE): 3.0
CA PERCD
State : CA and MSN : PERCV
Mean Absolute Error (MAE): 570.4
Mean Squared Error (MSE): 499705.08
Mean Absolute Percentage Error (MAPE): 8.46
CA PERCV
State : CA and MSN : PERSB
Mean Absolute Error (MAE): 39980.4
Mean Squared Error (MSE): 2101231044.4
Mean Absolute Percentage Error (MAPE): 8.02
CA PERSB
State : CA and MSN : PESCB
Mean Absolute Error (MAE): 192606.0
Mean Squared Error (MSE): 136900170181.6
Mean Absolute Percentage Error (MAPE): 3.88
CA PESCB
State : CA and MSN : PETCD
Mean Absolute Error (MAE): 1.39
Mean Squared Error (MSE): 2.28
Mean Absolute Percentage Error (MAPE): 8.87
CA PETCD
State : CA and MSN : PETCV
Mean Absolute Error (MAE): 10529.52
Mean Squared Error (MSE): 138679293.62
Mean Absolute Percentage Error (MAPE): 12.05
CA PETCV
State : CA and MSN : PETXD
Mean Absolute Error (MAE): 1.58
Mean Squared Error (MSE): 2.79
Mean Absolute Percentage Error (MAPE): 9.02
CA PETXD
State : CA and MSN : PETXV
Mean Absolute Error (MAE): 9990.82
Mean Squared Error (MSE): 130510776.64
Mean Absolute Percentage Error (MAPE): 12.53
CA PETXV
State : CA and MSN : PQACD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQACV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQCCD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQCCV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQICD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQICV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQISB
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQRCD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQRCV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQRFB
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQSCB
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQTCD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQTCV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQTXD
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : PQTXV
Error occoured in Combination State : CA and MSN : 130510776.64079988 Due NaN Value
State : CA and MSN : RFACD
Mean Absolute Error (MAE): 2.12
Mean Squared Error (MSE): 5.78
Mean Absolute Percentage Error (MAPE): 18.62
CA RFACD
State : CA and MSN : RFACV
Mean Absolute Error (MAE): 641.26
Mean Squared Error (MSE): 658262.62
Mean Absolute Percentage Error (MAPE): 28.05
CA RFACV
State : CA and MSN : RFCCD
Mean Absolute Error (MAE): 2.72
Mean Squared Error (MSE): 8.6
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFCCD
State : CA and MSN : RFCCV
Mean Absolute Error (MAE): 27.62
Mean Squared Error (MSE): 821.04
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFCCV
State : CA and MSN : RFEID
Mean Absolute Error (MAE): 8.56
Mean Squared Error (MSE): 73.84
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFEID
State : CA and MSN : RFEIV
Mean Absolute Error (MAE): 0.99
Mean Squared Error (MSE): 1.06
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFEIV
State : CA and MSN : RFICD
Mean Absolute Error (MAE): 4.02
Mean Squared Error (MSE): 35.54
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFICD
State : CA and MSN : RFICV
Mean Absolute Error (MAE): 0.26
Mean Squared Error (MSE): 0.18
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFICV
State : CA and MSN : RFISB
Mean Absolute Error (MAE): 26.4
Mean Squared Error (MSE): 1646.4
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFISB
State : CA and MSN : RFRFB
Mean Absolute Error (MAE): 153.08
Mean Squared Error (MSE): 27209.2
Mean Absolute Percentage Error (MAPE): inf
/tmp/ipykernel_14322/1611046908.py:39: RuntimeWarning:

divide by zero encountered in divide

CA RFRFB
State : CA and MSN : RFSCB
Mean Absolute Error (MAE): 41554.0
Mean Squared Error (MSE): 2134018850.0
Mean Absolute Percentage Error (MAPE): 25.01
CA RFSCB
State : CA and MSN : RFTCD
Mean Absolute Error (MAE): 2.12
Mean Squared Error (MSE): 5.79
Mean Absolute Percentage Error (MAPE): 18.65
CA RFTCD
State : CA and MSN : RFTCV
Mean Absolute Error (MAE): 629.24
Mean Squared Error (MSE): 596966.56
Mean Absolute Percentage Error (MAPE): 28.26
CA RFTCV
State : CA and MSN : RFTXD
Mean Absolute Error (MAE): 2.12
Mean Squared Error (MSE): 5.79
Mean Absolute Percentage Error (MAPE): 18.65
CA RFTXD
State : CA and MSN : RFTXV
Mean Absolute Error (MAE): 658.04
Mean Squared Error (MSE): 723103.08
Mean Absolute Percentage Error (MAPE): 28.25
CA RFTXV
State : CA and MSN : SNICD
Mean Absolute Error (MAE): 1.73
Mean Squared Error (MSE): 3.82
Mean Absolute Percentage Error (MAPE): 8.23
CA SNICD
State : CA and MSN : SNICV
Mean Absolute Error (MAE): 12.67
Mean Squared Error (MSE): 196.15
Mean Absolute Percentage Error (MAPE): 12.21
CA SNICV
State : CA and MSN : TEACD
Mean Absolute Error (MAE): 2.14
Mean Squared Error (MSE): 6.11
Mean Absolute Percentage Error (MAPE): 9.56
CA TEACD
State : CA and MSN : TEACV
Mean Absolute Error (MAE): 9362.99
Mean Squared Error (MSE): 116336944.11
Mean Absolute Percentage Error (MAPE): 15.62
CA TEACV
State : CA and MSN : TECCD
Mean Absolute Error (MAE): 0.59
Mean Squared Error (MSE): 0.56
Mean Absolute Percentage Error (MAPE): 1.98
CA TECCD
State : CA and MSN : TECCV
Mean Absolute Error (MAE): 946.73
Mean Squared Error (MSE): 1207220.49
Mean Absolute Percentage Error (MAPE): 4.25
CA TECCV
State : CA and MSN : TEGDS
Error occoured in Combination State : CA and MSN : 1207220.4921927233 Due NaN Value
State : CA and MSN : TEICD
Mean Absolute Error (MAE): 0.64
Mean Squared Error (MSE): 0.61
Mean Absolute Percentage Error (MAPE): 4.78
CA TEICD
State : CA and MSN : TEICV
Mean Absolute Error (MAE): 1745.05
Mean Squared Error (MSE): 3385434.41
Mean Absolute Percentage Error (MAPE): 12.15
CA TEICV
State : CA and MSN : TEPFB
Mean Absolute Error (MAE): 59310.0
Mean Squared Error (MSE): 5829371086.0
Mean Absolute Percentage Error (MAPE): 2.7
CA TEPFB
State : CA and MSN : TERCD
Mean Absolute Error (MAE): 0.76
Mean Squared Error (MSE): 0.95
Mean Absolute Percentage Error (MAPE): 2.52
CA TERCD
State : CA and MSN : TERCV
Mean Absolute Error (MAE): 1614.19
Mean Squared Error (MSE): 4289289.73
Mean Absolute Percentage Error (MAPE): 6.55
CA TERCV
State : CA and MSN : TERFB
Mean Absolute Error (MAE): 47624.37
Mean Squared Error (MSE): 2375324819.51
Mean Absolute Percentage Error (MAPE): 12.1
CA TERFB
State : CA and MSN : TETCD
Mean Absolute Error (MAE): 1.19
Mean Squared Error (MSE): 1.81
Mean Absolute Percentage Error (MAPE): 5.39
CA TETCD
State : CA and MSN : TETCV
Mean Absolute Error (MAE): 10058.92
Mean Squared Error (MSE): 128352717.06
Mean Absolute Percentage Error (MAPE): 8.26
CA TETCV
State : CA and MSN : TETPV
Mean Absolute Error (MAE): 257.99
Mean Squared Error (MSE): 85871.79
Mean Absolute Percentage Error (MAPE): 8.41
CA TETPV
State : CA and MSN : TETXD
Mean Absolute Error (MAE): 1.19
Mean Squared Error (MSE): 1.81
Mean Absolute Percentage Error (MAPE): 5.39
CA TETXD
State : CA and MSN : TETXV
Mean Absolute Error (MAE): 10058.92
Mean Squared Error (MSE): 128352717.06
Mean Absolute Percentage Error (MAPE): 8.26
CA TETXV
State : CA and MSN : TNASB
Mean Absolute Error (MAE): 212749.91
Mean Squared Error (MSE): 88070372552.62
Mean Absolute Percentage Error (MAPE): 8.27
CA TNASB
State : CA and MSN : TNCSB
Mean Absolute Error (MAE): 13047.02
Mean Squared Error (MSE): 435707814.08
Mean Absolute Percentage Error (MAPE): 1.83
CA TNCSB
State : CA and MSN : TNISB
Mean Absolute Error (MAE): 40593.31
Mean Squared Error (MSE): 2735674924.74
Mean Absolute Percentage Error (MAPE): 4.02
CA TNISB
State : CA and MSN : TNRSB
Mean Absolute Error (MAE): 42069.6
Mean Squared Error (MSE): 2463471651.6
Mean Absolute Percentage Error (MAPE): 5.19
CA TNRSB
State : CA and MSN : TNSCB
Mean Absolute Error (MAE): 223630.62
Mean Squared Error (MSE): 119081125511.73
Mean Absolute Percentage Error (MAPE): 4.42
CA TNSCB
State : CA and MSN : TPOPP
Mean Absolute Error (MAE): 549.12
Mean Squared Error (MSE): 450279.25
Mean Absolute Percentage Error (MAPE): 1.39
CA TPOPP
State : CA and MSN : WDRCD
Mean Absolute Error (MAE): 0.95
Mean Squared Error (MSE): 1.32
Mean Absolute Percentage Error (MAPE): 9.54
CA WDRCD
State : CA and MSN : WDRCV
Mean Absolute Error (MAE): 17.62
Mean Squared Error (MSE): 355.47
Mean Absolute Percentage Error (MAPE): 18.12
CA WDRCV
State : CA and MSN : WDRSB
Mean Absolute Error (MAE): 1715.26
Mean Squared Error (MSE): 3899803.53
Mean Absolute Percentage Error (MAPE): 19.33
CA WDRSB
State : CA and MSN : WDRXB
Mean Absolute Error (MAE): 4011.31
Mean Squared Error (MSE): 18789003.91
Mean Absolute Percentage Error (MAPE): 32.07
CA WDRXB
State : CA and MSN : WWCCD
Mean Absolute Error (MAE): 0.39
Mean Squared Error (MSE): 0.16
Mean Absolute Percentage Error (MAPE): 18.67
CA WWCCD
State : CA and MSN : WWCCV
Mean Absolute Error (MAE): 7.86
Mean Squared Error (MSE): 68.35
Mean Absolute Percentage Error (MAPE): 34.02
CA WWCCV
State : CA and MSN : WWCSB
Mean Absolute Error (MAE): 2718.8
Mean Squared Error (MSE): 8255430.76
Mean Absolute Percentage Error (MAPE): 24.91
CA WWCSB
State : CA and MSN : WWCXB
Mean Absolute Error (MAE): 256.0
Mean Squared Error (MSE): 77899.2
Mean Absolute Percentage Error (MAPE): 11.81
CA WWCXB
State : CA and MSN : WWEID
Mean Absolute Error (MAE): 0.4
Mean Squared Error (MSE): 0.22
Mean Absolute Percentage Error (MAPE): 19.34
CA WWEID
State : CA and MSN : WWEIV
Mean Absolute Error (MAE): 55.1
Mean Squared Error (MSE): 3416.06
Mean Absolute Percentage Error (MAPE): 40.41
CA WWEIV
State : CA and MSN : WWICD
Mean Absolute Error (MAE): 0.35
Mean Squared Error (MSE): 0.18
Mean Absolute Percentage Error (MAPE): 14.44
CA WWICD
State : CA and MSN : WWICV
Mean Absolute Error (MAE): 14.37
Mean Squared Error (MSE): 422.92
Mean Absolute Percentage Error (MAPE): 19.56
CA WWICV
State : CA and MSN : WWISB
Mean Absolute Error (MAE): 5740.95
Mean Squared Error (MSE): 59514619.12
Mean Absolute Percentage Error (MAPE): 19.77
CA WWISB
State : CA and MSN : WWIXB
Mean Absolute Error (MAE): 1824.6
Mean Squared Error (MSE): 4190107.0
Mean Absolute Percentage Error (MAPE): 16.17
CA WWIXB
State : CA and MSN : WWSCB
Mean Absolute Error (MAE): 8306.4
Mean Squared Error (MSE): 72285704.4
Mean Absolute Percentage Error (MAPE): 7.6
CA WWSCB
State : CA and MSN : WWTCD
Mean Absolute Error (MAE): 0.32
Mean Squared Error (MSE): 0.18
Mean Absolute Percentage Error (MAPE): 11.44
CA WWTCD
State : CA and MSN : WWTCV
Mean Absolute Error (MAE): 194.9
Mean Squared Error (MSE): 38605.37
Mean Absolute Percentage Error (MAPE): 58.87
CA WWTCV
State : CA and MSN : WWTXD
Mean Absolute Error (MAE): 0.62
Mean Squared Error (MSE): 0.62
Mean Absolute Percentage Error (MAPE): 16.86
CA WWTXD
State : CA and MSN : WWTXV
Mean Absolute Error (MAE): 16.08
Mean Squared Error (MSE): 356.7
Mean Absolute Percentage Error (MAPE): 8.8
CA WWTXV
State : CA and MSN : WXICD
Mean Absolute Error (MAE): 4.37
Mean Squared Error (MSE): 29.15
Mean Absolute Percentage Error (MAPE): 15.02
CA WXICD
State : CA and MSN : WXICV
Mean Absolute Error (MAE): 12.38
Mean Squared Error (MSE): 224.26
Mean Absolute Percentage Error (MAPE): 31.97
CA WXICV
State : CA and MSN : ZWCDP
Mean Absolute Error (MAE): 114.15
Mean Squared Error (MSE): 16826.06
Mean Absolute Percentage Error (MAPE): 10.41
CA ZWCDP
State : CA and MSN : ZWHDP
Mean Absolute Error (MAE): 128.12
Mean Squared Error (MSE): 38280.58
Mean Absolute Percentage Error (MAPE): 4.65
CA ZWHDP

Using Sarima¶

In [10]:
os.makedirs('Plots/Sarima_results_plots',exist_ok=True)

for State in df_trans['State'].unique():
    for msn in df_trans['MSN'].unique():
        try:
            
            fig = go.Figure()

            print('State : {} and MSN : {}'.format(State,msn))
            # Get the energy consumption data for the current country and sector
            df_filter = df_trans[(df_trans['State'] == State) & (
                df_trans['MSN'] == msn)][['Year', 'Yearly Data']]
            df_filter_index = df_filter.set_index('Year')

            train_data = df_filter[:-5]
            test_data = df_filter[-5:]
            
            # Prepare the data for modeling
            years = df_filter_index.index
            energy_consumption = df_filter_index.values.flatten()

                    # Split the data into training and testing
            # Use all data except the last 5 years for training
            Horizan = -5
            train_data = energy_consumption[:Horizan]
            test_data = energy_consumption[Horizan:]  # Use the last 5 years for testing

            # Fit the auto ARIMA model
            model = auto_arima(train_data, seasonal=True)
            model.fit(train_data)

            # Generate predictions
            predictions = model.predict(n_periods=len(test_data))
            predictions_ahead_in_future = model.predict(n_periods=len(test_data)+15)

            # Calculate evaluation metrics
            mae = mean_absolute_error(test_data, predictions)
            mse = mean_squared_error(test_data, predictions)
            mape = np.mean(np.abs((test_data - predictions) / test_data)) * 100

            print('Mean Absolute Error (MAE):', np.round(mae,2))
            print('Mean Squared Error (MSE):', np.round(mse,2))
            print('Mean Absolute Percentage Error (MAPE):', np.round(mape,2))
            
            # Plot the training data
            fig.add_trace(go.Scatter(
                x=years[:Horizan], y=train_data, mode='lines+markers', name='Training Data'))

            # Plot the predictions
            fig.add_trace(go.Scatter(
                x=years[Horizan:], y=test_data, mode='lines+markers', name='Actual'))
            fig.add_trace(go.Scatter(
                x=years[Horizan:], y=predictions, mode='lines+markers', name='Predicted'))

            fig.add_trace(go.Scatter(
                x=pd.date_range(start = years[Horizan],periods=15,freq='Y'), y=predictions_ahead_in_future, mode='lines+markers', name='Prediction till 2030'))

            # Update the layout
            fig.update_layout(title=f'Energy Consumption Forecast State using SARIMA : {State} : MSN : {msn} ',
                            xaxis_title='Year', yaxis_title='Energy Consumption')

            # Show the plot
            fig.show()
            print(State,msn)
            fig.write_image(f'Plots/Sarima_results_plots/{State}_{msn}.png')
            # break
        except:
            print('Error occoured in Combination State : {} and MSN : {} Due NaN Value'.format(State,mse))
        break
State : CA and MSN : ARICD
Mean Absolute Error (MAE): 1.7
Mean Squared Error (MSE): 3.99
Mean Absolute Percentage Error (MAPE): 15.68
CA ARICD